package com.eqdd.yiqidian.ui.mine.shenqing

import com.eqdd.nextinputs.StaticScheme
import com.eqdd.yiqidian.bean.rebuild.slimedit.SlimEditEnterBean
import com.eqdd.yiqidian.bean.rebuild.slimedit.SlimEditHintBean
import com.eqdd.yiqidian.bean.rebuild.slimedit.SlimTimeSelectBean
import com.eqdd.yiqidian.http.HttpConfig
import com.eqdd.yiqidian.utils.SingleChooseUtil
import com.eqdd.yiqidian.widget.ActionSheetDialog
import com.lzy.okgo.model.HttpParams

/**
 * 加班申请
 * Created by jhj on 18-6-11.
 */
class ApplyOverTimeActivity : BaseApplyActivity() {


    override val mTitle: String
        get() = "加班申请"
    override val url: String
        get() = HttpConfig.BASE_URL + HttpConfig.CREATE_OVER_TIME
    override val isRequestLeader: Boolean
        get() = true
    override val leaderIndex: Int?
        get() = 9

    override fun uploadParams(): HttpParams {
        params.put("startOverTime", setParam(4))
        params.put("endOverTime", setParam(5))
        params.put("times", setParam(6))
        params.put("overTimeType", setParam(7))
        params.put("overTimeReason", setParam(8))
        return params
    }

    override fun itemClick(p: Int) {
        when (p) {
            4 -> {
                isUpper = true
                openTimePicker(4, 5, true)
            }
            5 -> {
                isUpper = false
                openTimePicker(4, 5, true)
            }
            7 -> bottomDialog(7, 34)
        }
    }


    override fun setEditBeans() {
        super.setEditBeans()
        datas.add(SlimTimeSelectBean("请假开始时间", "", 4, "请选择").setStartTime(true).setNeed(true))
        datas.add(SlimTimeSelectBean("请假结束时间", "", 5, "请选择").setStartTime(false).setNeed(true))
        datas.add(SlimEditEnterBean("加班时长", "", 6, "请输入").addSchemes(StaticScheme.Numeric()).setNeed(true))
        datas.add(SlimEditEnterBean("加班类型", "", 7, true, "请选择").setNeed(true))
        datas.add(SlimEditEnterBean("加班原因", "", 8, "请输入").setNeed(true))
        datas.add(SlimEditHintBean("审批人", "", 9))
    }

}